/* 
 * File:   Tanh.cpp
 * Author: Gab'z
 * 
 * Created on 4 juin 2012, 09:41
 */

#include "Tanh.h"
#include "../../../Context.h"
#include "../../literal/Stack.h"
#include "../../literal/Complex.h"
#include "../../literal/Real.h"

namespace calculator {

    Tanh::Tanh(const std::string name) : AngularUnaryOperator(name) {
    }

    Tanh::Tanh(const Tanh& orig) : AngularUnaryOperator(orig._name) {
    }

    Tanh::~Tanh() {
    }

    Tanh* Tanh::clone() const {
        return new Tanh(_name);
    }

    const Number* Tanh::apply(const SimpleNumber* sn) const throw (ArithmeticException) {
        return new Real(std::tanh(sn->value()));
    }

}